/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "PUB_WZCG")
public class PubWzcg extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "物资采购";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_SQRBH = "申请人";
	public static final String ALIAS_SQRXM = "员工编号";
	public static final String ALIAS_BM = "部门";
	public static final String ALIAS_GWZW = "岗位职务";
	public static final String ALIAS_GZLB = "固资类别";
	public static final String ALIAS_YSQKSM = "预算情况说明";
	public static final String ALIAS_XHGG = "型号规格";
	public static final String ALIAS_XDRQ = "下单日期";
	public static final String ALIAS_CGZQ = "采购周期";
	public static final String ALIAS_YJDHRQ = "预计到货日期";
	public static final String ALIAS_HQBGSM = "货期变更说明";
	public static final String ALIAS_SJDHRQ = "实际到货日期";
	public static final String ALIAS_YXJ = "优先级";
	public static final String ALIAS_FFDW = "是否发放到位";
	
	//date formats
	public static final String FORMAT_XDRQ = DATE_FORMAT;
	public static final String FORMAT_YJDHRQ = DATE_FORMAT;
	public static final String FORMAT_SJDHRQ = DATE_FORMAT;
	public static final String FORMAT_LQRQ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	@Length(max=32)
	private java.lang.String id;
    /**
     * 申请人       db_column: SQRBH 
     */ 	
	@Length(max=30)
	private java.lang.String sqrbh;
    /**
     * 员工编号       db_column: SQRXM 
     */ 	
	@Length(max=30)
	private java.lang.String sqrxm;
    /**
     * 部门       db_column: BM 
     */ 	
	@Length(max=60)
	private java.lang.String bm;
    /**
     * 岗位职务       db_column: GWZW 
     */ 	
	@Length(max=60)
	private java.lang.String gwzw;
    /**
     * 固资类别       db_column: GZLB 
     */ 	
	@Length(max=30)
	private java.lang.String gzlb;
    /**
     * 预算情况说明       db_column: YSQKSM 
     */ 	
	@Length(max=400)
	private java.lang.String ysqksm;
    /**
     * 型号规格       db_column: XHGG 
     */ 	
	@Length(max=300)
	private java.lang.String xhgg;
    /**
     * 下单日期       db_column: XDRQ 
     */ 	
	
	private java.util.Date xdrq;
    /**
     * 采购周期       db_column: CGZQ 
     */ 	
	@Length(max=60)
	private java.lang.String cgzq;
    /**
     * 预计到货日期       db_column: YJDHRQ 
     */ 	
	
	private java.util.Date yjdhrq;
    /**
     * 货期变更说明       db_column: HQBGSM 
     */ 	
	@Length(max=400)
	private java.lang.String hqbgsm;
    /**
     * 实际到货日期       db_column: SJDHRQ 
     */ 	
	
	private java.util.Date sjdhrq;
    /**
     * 优先级       db_column: YXJ 
     */ 	
	@Length(max=30)
	private java.lang.String yxj;
    /**
     * 是否发放到位       db_column: FFDW 
     */ 	
	@Length(max=10)
	private java.lang.String ffdw;
	/**
     * 领取日期       db_column: LQRQ 
     */ 	
	
	private java.util.Date lqrq;
    /**
     * 序列号       db_column: XLH 
     */ 	
	@Length(max=30)
	private java.lang.String xlh;
    /**
     * 资产编号       db_column: ZCBH 
     */ 	
	@Length(max=30)
	private java.lang.String zcbh;
	//columns END


	public PubWzcg(){
	}

	public PubWzcg(
		java.lang.String id
	){
		this.id = id;
	}

	

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid.hex")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getId() {
		return this.id;
	}
	
	@Column(name = "SQRBH", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getSqrbh() {
		return this.sqrbh;
	}
	
	public void setSqrbh(java.lang.String value) {
		this.sqrbh = value;
	}
	
	@Column(name = "SQRXM", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getSqrxm() {
		return this.sqrxm;
	}
	
	public void setSqrxm(java.lang.String value) {
		this.sqrxm = value;
	}
	
	@Column(name = "BM", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getBm() {
		return this.bm;
	}
	
	public void setBm(java.lang.String value) {
		this.bm = value;
	}
	
	@Column(name = "GWZW", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getGwzw() {
		return this.gwzw;
	}
	
	public void setGwzw(java.lang.String value) {
		this.gwzw = value;
	}
	
	@Column(name = "GZLB", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getGzlb() {
		return this.gzlb;
	}
	
	public void setGzlb(java.lang.String value) {
		this.gzlb = value;
	}
	
	@Column(name = "YSQKSM", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getYsqksm() {
		return this.ysqksm;
	}
	
	public void setYsqksm(java.lang.String value) {
		this.ysqksm = value;
	}
	
	@Column(name = "XHGG", unique = false, nullable = true, insertable = true, updatable = true, length = 300)
	public java.lang.String getXhgg() {
		return this.xhgg;
	}
	
	public void setXhgg(java.lang.String value) {
		this.xhgg = value;
	}
	
	@Transient
	public String getXdrqString() {
		return DateConvertUtils.format(getXdrq(), FORMAT_XDRQ);
	}
	public void setXdrqString(String value) {
		setXdrq(DateConvertUtils.parse(value, FORMAT_XDRQ,java.util.Date.class));
	}
	
	@Column(name = "XDRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getXdrq() {
		return this.xdrq;
	}
	
	public void setXdrq(java.util.Date value) {
		this.xdrq = value;
	}
	
	@Column(name = "CGZQ", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getCgzq() {
		return this.cgzq;
	}
	
	public void setCgzq(java.lang.String value) {
		this.cgzq = value;
	}
	
	@Transient
	public String getYjdhrqString() {
		return DateConvertUtils.format(getYjdhrq(), FORMAT_YJDHRQ);
	}
	public void setYjdhrqString(String value) {
		setYjdhrq(DateConvertUtils.parse(value, FORMAT_YJDHRQ,java.util.Date.class));
	}
	
	@Column(name = "YJDHRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getYjdhrq() {
		return this.yjdhrq;
	}
	
	public void setYjdhrq(java.util.Date value) {
		this.yjdhrq = value;
	}
	
	@Column(name = "HQBGSM", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getHqbgsm() {
		return this.hqbgsm;
	}
	
	public void setHqbgsm(java.lang.String value) {
		this.hqbgsm = value;
	}
	
	@Transient
	public String getSjdhrqString() {
		return DateConvertUtils.format(getSjdhrq(), FORMAT_SJDHRQ);
	}
	public void setSjdhrqString(String value) {
		setSjdhrq(DateConvertUtils.parse(value, FORMAT_SJDHRQ,java.util.Date.class));
	}
	
	@Column(name = "SJDHRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getSjdhrq() {
		return this.sjdhrq;
	}
	
	public void setSjdhrq(java.util.Date value) {
		this.sjdhrq = value;
	}
	
	@Column(name = "YXJ", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getYxj() {
		return this.yxj;
	}
	
	public void setYxj(java.lang.String value) {
		this.yxj = value;
	}
	
	@Column(name = "FFDW", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.String getFfdw() {
		return this.ffdw;
	}
	
	public void setFfdw(java.lang.String value) {
		this.ffdw = value;
	}
	
	@Transient
	public String getLqrqString() {
		return DateConvertUtils.format(getLqrq(), FORMAT_LQRQ);
	}
	public void setLqrqString(String value) {
		setLqrq(DateConvertUtils.parse(value, FORMAT_LQRQ,java.util.Date.class));
	}
	
	@Column(name = "LQRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getLqrq() {
		return this.lqrq;
	}
	
	public void setLqrq(java.util.Date value) {
		this.lqrq = value;
	}
	
	@Column(name = "XLH", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getXlh() {
		return this.xlh;
	}
	
	public void setXlh(java.lang.String value) {
		this.xlh = value;
	}
	
	@Column(name = "ZCBH", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getZcbh() {
		return this.zcbh;
	}
	
	public void setZcbh(java.lang.String value) {
		this.zcbh = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Sqrbh",getSqrbh())
			.append("Sqrxm",getSqrxm())
			.append("Bm",getBm())
			.append("Gwzw",getGwzw())
			.append("Gzlb",getGzlb())
			.append("Ysqksm",getYsqksm())
			.append("Xhgg",getXhgg())
			.append("Xdrq",getXdrq())
			.append("Cgzq",getCgzq())
			.append("Yjdhrq",getYjdhrq())
			.append("Hqbgsm",getHqbgsm())
			.append("Sjdhrq",getSjdhrq())
			.append("Yxj",getYxj())
			.append("Ffdw",getFfdw())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PubWzcg == false) return false;
		if(this == obj) return true;
		PubWzcg other = (PubWzcg)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

